package com.ruoyi.web.controller.system;

import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.system.domain.AOperationRecords;
import com.ruoyi.system.service.IAOperationRecordsService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;

/**
 * 下载收藏分享点赞记录Controller
 * 
 * @author ruoyi
 * @date 2024-05-16
 */
@RestController
@RequestMapping("/system/aOperationRecords")
public class AOperationRecordsController extends BaseController
{
    @Autowired
    private IAOperationRecordsService aOperationRecordsService;

    /**
     * 查询下载收藏分享点赞记录列表
     */
    @GetMapping("/list")
    public TableDataInfo list(AOperationRecords aOperationRecords)
    {
        startPage();
        List<AOperationRecords> list = aOperationRecordsService.selectAOperationRecordsList(aOperationRecords);
        return getDataTable(list);
    }

    /**
     * 导出下载收藏分享点赞记录列表
     */
    @Log(title = "下载收藏分享点赞记录", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, AOperationRecords aOperationRecords)
    {
        List<AOperationRecords> list = aOperationRecordsService.selectAOperationRecordsList(aOperationRecords);
        ExcelUtil<AOperationRecords> util = new ExcelUtil<AOperationRecords>(AOperationRecords.class);
        util.exportExcel(response, list, "下载收藏分享点赞记录数据");
    }

    /**
     * 获取下载收藏分享点赞记录详细信息
     */
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return success(aOperationRecordsService.selectAOperationRecordsById(id));
    }

    /**
     * 新增下载收藏分享点赞记录
     */
    @Log(title = "下载收藏分享点赞记录", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody AOperationRecords aOperationRecords)
    {
        return toAjax(aOperationRecordsService.insertAOperationRecords(aOperationRecords));
    }

    /**
     * 修改下载收藏分享点赞记录
     */
    @Log(title = "下载收藏分享点赞记录", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody AOperationRecords aOperationRecords)
    {
        return toAjax(aOperationRecordsService.updateAOperationRecords(aOperationRecords));
    }

    /**
     * 删除下载收藏分享点赞记录
     */
    @Log(title = "下载收藏分享点赞记录", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(aOperationRecordsService.deleteAOperationRecordsByIds(ids));
    }
}
